package com.zb.kc.cms.controller;


import com.zb.kc.cms.entity.CrmBanner;
import com.zb.kc.cms.service.CrmBannerService;
import com.zb.kc.commonutils.R;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * 前台系统
 * </p>
 *
 * @author wanggen
 * @since 2020-04-19
 */
@RestController
@RequestMapping("/educms/bannerfront")
@Slf4j
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;

    @ApiOperation(value = "获取前两条banner")
    @GetMapping
    public R getAllBanner() {
        List<CrmBanner> banners = bannerService.selectAllBanner();
        return R.ok().data(banners);
    }

}
